<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    var n1 = 8;
    let n2 = 9;//定义变量
    const n3 = 10;//定义常量

    console.log(n3);

    //js函数名是变量，是指向函数的引用，函数也是对象
    function f1(){
        console.log("f1=====================");
    }

    f1();

    let f2 = f1;
    f2();

    let f3 = function(){
        console.log("f3=====================");
    };

    let f4 = f3;
    f4();

    let execFun = function(func){
        func();
    };

    execFun(f1);

    execFun(function(){
        console.log("OK====================>1");
    });

    const getFun = function(){
        return function(){
            console.log("OK====================>2");
        };
    };

    //let ff = getFun();
    //ff();
    getFun()();

    const f5 = ()=>{
        console.log("OK====================>3");
    }

    f5();

    execFun(()=>{
        console.log("箭头函数！");
    });

    //js对象
    let obj1 = {
        a:1,
        b:"123",
        f1:function(){
            console.log(this.a+","+this.b);
        },
        f2(){
            console.log("f2:::"+this.a+","+this.b);
        },
        f3:()=>{
            console.log("大家好");
        }
    };

    obj1.f3();





</script>


</body>
</html>